def write_txt():
    date = input("请输入今天的日期：")
    text = input("请输入日记内容：")
    f = open('note.txt', mode='a', encoding='utf-8')
    f.write('pyrjb\n')
    f.write(date + '\n')
    f.write((text + '\n'))
    f.close()
    return True


def read_txt(day='-1'):
    f = open('note.txt', mode='r', encoding='utf-8')
    context = f.read()
    f.close()
    if day != '-1':
        arr = context.split("pyrjb\n")
        print(arr)
        for a in arr:
            if a[:10] == day:
                print(a)
                return True
        return False
    else:
        context = context.replace('pyrjb\n', '')
        print(context)

    return True


def quit():
    print("欢迎下次使用")


def menu():
    print("*" * 30)
    print('''欢迎使用python日记本系统
    1：记日记
    2：阅读日记
    3：退出系统''')
    print("*" * 30)
